package com.example.materials_management.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "materials_remaining_info", schema = "materials_piyo", catalog = "")
public class MaterialsRemainingInfoEntity {
    private int id;
    private int remainingAmount;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "remaining_amount")
    public int getRemainingAmount() {
        return remainingAmount;
    }

    public void setRemainingAmount(int remainingAmount) {
        this.remainingAmount = remainingAmount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MaterialsRemainingInfoEntity that = (MaterialsRemainingInfoEntity) o;
        return id == that.id && remainingAmount == that.remainingAmount;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, remainingAmount);
    }
}
